"use strict";
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
  class Gg_notice extends Model {
    /**
     * Helper method for defining associations.
     * This method is not a part of Sequelize lifecycle.
     * The `models/index` file will call this method automatically.
     */
    static associate(models) {
      // define association here
    }
  }
  Gg_notice.init(
    {
      user_id: DataTypes.INTEGER,
      notice_content:  {
        type: DataTypes.TEXT,
        allowNull: false,
        validate: {
          notNull: {
            msg: "公告内容 必须存在!",
          },
          notEmpty: {
            msg: "公告内容 不能为空!",
          },
        },
      },
      notice_time: DataTypes.DATE,
    },
    {
      sequelize,
      modelName: "Gg_notice",
    }
  );
  return Gg_notice;
};
